const express = require("express");
const router = express.Router();
const path = require("path");
const Sequelize = require("sequelize");
let myTable = require("../commen/mysql");
let mail = require('../controller/mail');
/* GET home page. */

router.get("/userInfo", function (req, res, next) {
    let send = async () => {
        try {
            //获取动态，获取评论
            let user_id = req.body.user_id;
            let answers = await myTable.answers.findAll({

            });
            //关注与被关注人数
            let relations = await myTable.relations.findAll({

            });
            res.send({ code: 0, answers: answers , relations:relations })
        }
        catch (e) {
            console.log(e);
            res.send({ code: 1, data: e });
        }

    }
    send();
});

router.get('/mail',function(req,res){
    mail();
    res.send('success');
});

module.exports = router;
